<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="Vytvoření nového účtu"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <!--   <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>-->
               
            </h:panelGroup>
            <h:form id="newUserForm" onkeypress="if (event.keyCode == 13) { document.getElementById('newUserForm:newUserConfirm').click(); return false; }">
                <h:panelGrid columns="1">
                     <h:outputLabel styleClass="infoLabel" value="#{newUserBean.info}"/>
                    <h:outputLabel value="Přihlašovací jméno"/>
                    <h:panelGroup>
                        <h:inputText id="newUserName" value="#{newUserBean.name}"/>
                        <h:message styleClass="messageStyle" for="newUserName"/>
                    </h:panelGroup>

                    <h:outputLabel value="Vaše telefonní číslo*"/>
                    <h:panelGroup>
                        <h:inputText id="newUserPhone" value="#{newUserBean.phoneNumber}"/>
                        <h:message styleClass="messageStyle" for="newUserPhone"/>
                    </h:panelGroup>

                    <h:outputLabel value="Vaše heslo"/>
                    <h:panelGroup>
                        <h:inputSecret id="newUserPassword" value="#{newUserBean.password}" redisplay="true"/>
                        <h:message styleClass="messageStyle" for="newUserPassword"/>
                    </h:panelGroup>

                    <h:outputLabel value="Kontrola hesla"/>
                    <h:inputSecret id="secondPassword" value="#{newUserBean.secondPassword}" redisplay="true"/>
                    <h:outputLabel value="Validační kód"/>
                    <h:panelGroup>
                        <h:inputText value="#{newUserBean.code}"/>
                        <h:commandButton styleClass="button" value="Zaslat kód" action="#{newUserBean.sendCode}"/>
                    </h:panelGroup>
                <h:commandButton id="newUserConfirm" styleClass="button" action="#{newUserBean.createUser}" value="Vytvořit účet" />
                *Služba je dostupná pouze pro čísla operátora O2
                </h:panelGrid>
                
            </h:form>
        </ui:define>
    </ui:composition>

</html>
